package cn.wolfcode.web.controller;

import cn.wolfcode.domain.JsonResult;
import cn.wolfcode.qo.QueryObject;
import cn.wolfcode.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/permission")
public class PermissionController {
    @Autowired
    private IPermissionService permissionService;

    @RequestMapping("/list")
    public String list(QueryObject qo, Model model) {
        model.addAttribute("pageInfo", permissionService.selectAll(qo));
        return "/permission/list";
    }
    @RequestMapping("/reload")
    public JsonResult reload(){
        permissionService.reload();
        return new JsonResult();
    }
}
